unit UFrmFieldEditor;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, ToolWin, ImgList;

type
  TFrmFieldEditor = class(TForm)
    btn1: TBitBtn;
    btn2: TBitBtn;
    bvl1: TBevel;
    ToolBar1: TToolBar;
    ToolButton1: TToolButton;
    ToolButton2: TToolButton;
    ToolButton3: TToolButton;
    ImageList1: TImageList;
    procedure btn1Click(Sender: TObject);
  private
    { Private declarations }
  public
    SQL: string;
  end;


implementation

uses UDM;
const
  StrFieldType ='Char'#13'Varchar'#13'Int'#13'Money'#13'Datetime';
{$R *.dfm}

procedure TFrmFieldEditor.btn1Click(Sender: TObject);
var
  StrType: string;
  bExistsField: Boolean;
begin
{  bExistsField := False;
  for i := 0 to dmSQL.qryGrid.FieldCount - 1 do
  begin
    if UpperCase(Trim(edtFieldName.Text)) = dmSQL.qryGrid.Fields[i].FieldName then
    begin
      bExistsField := True;
      Exit;
    end;
  end;
  if bExistsField then
  begin

  end;
  StrType := UpperCase(Trim(cbbFieldType.Text));
  SQL := ' Add ' + edtFieldName.Text + ' ' + cbbFieldType.Text;
  if (StrType = 'VARCHAR') or (StrType = 'CHAR') then
    SQL := SQL + '(' + edtLength.Text + ')';}
end;




end.

